<template>
    <view>
        <u-tabs :list="list1" @click="tabsClick"></u-tabs>
        <directFacPurchase :valueVal="valueVal" v-if="name == this.$lang('采购单')"></directFacPurchase>
        <directProduction :valueVal="valueVal" v-if="name == this.$lang('生产单')"></directProduction>
    </view>
</template>

<script>
    import directFacPurchase from "./directFacPurchase";
    import directProduction from "./directProduction";
    export default {
        components:{
            directFacPurchase,
            directProduction
        },
        options: {
            styleIsolation: 'shared'
        },
        props:{
            valueVal:''
        },
        watch: {
            valueVal: {
                immediate: true, //立即执行
                deep: true, //深度侦听复杂类型
                handler(newval, oldval) {
                    // this.getList();
                }
            }
        },
        data() {
            return {
                name:'采购单',
                list1:[
                    {name:this.$lang('采购单')},
                    {name:this.$lang('生产单')},
                ]
            }
        },
        created() {

        },
        mounted() {

        },
        methods:{
            tabsClick(e){
                this.name = e.name;
            },
        }
    }
</script>
<style lang="scss" scoped>

</style>
